package com.tvunetworks.center.user.mapper;

import com.tvunetworks.center.user.model.Feature;
import com.tvunetworks.center.user.model.UserAuthorize;
import com.tvunetworks.center.user.model.vo.FeatureVo;
import com.tvunetworks.center.user.model.vo.UserFeatureVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
/**
 * @program:
 * @description:
 * @author HenryChen
 * @create: 5/23/2019 1:54 PM
 **/
public interface FeatureMapper extends Mapper<Feature> {
    /**
     *
     * @return List
     */
    List<UserAuthorize> listUserAuthorize();

    /**
     *
     * @return List
     */
    List<FeatureVo> listAll();

    /**
     * Admin默认拥有的feature
     * @return List
     */
    List<FeatureVo> listAdminAutoOwnFeature();

    /**
     * 非Admin默认拥有的feature
     * @return List
     */
    List<FeatureVo> listNotAdminAutoOwnFeature();

    /**
     * 用户拥有的 非Admin默认拥有的feature
     * @param  userId userId
     * @return List
     */
    List<FeatureVo> listUserNotAdminAutoOwnFeature(String userId);

    /**
     * 查询最大的OrderNo
     * @return int
     */
    int getMaxOrderNo();

    /**
     * 根据featureIds查询出所有的 UserFeatureVo
     * 不需要管理enable属性，这个属性后面再处理
     * @param featureIds featureIds
     * @return List
     */
    List<UserFeatureVo> listFeatureVoByFeatureIds(@Param("featureIds") List<String> featureIds);

    /**
     * 列出用户可以为孩子提供Feature中的adminAutoOwn 的featureId列表
     * 用于在创建用户，或者修改用户权限的时候，查询自己拥有的所有feature，返回结果显示框供勾选
     * @return List
     */
    List<String> listAdminAutoOwnFeatureIds();

    /**
     * 用户id查询feature
     * @param userId userId
     * @return List
     */
    List<String> listFeatureByUserId(String userId);
}
